$TITLE ('PL/M-51 TO RTX-51 V5.0 INTERFACE')
$SYMBOLS
$NOXREF
$NOCOND
$NOMOD51
$NORB
$PAGELENGTH(80) PAGEWIDTH(110)
;************************************************************************
;*									*
;*    R T X - 5 1  :   PL/M-51 TO RTX-51 V5.0 INTERFACE FILE 2          *
;*							     		*
;*----------------------------------------------------------------------*
;*                                                                      *
;*    Filename     :   RTXPLM2.A51                                      *
;*    Language     :   Keil A-51                                        *
;*    Dev. system  :   Keil uVision2                                    *
;*    Targetsystem :   Any system based upon 8051 up                    *
;*                                                                      *
;*    Purpose      :   Implements the second part of the PL/M-51 to     *
;*                     RTX-51 V4.xx Interface. This Interface is        *
;*                     dedicated for special purposes (Bitbus-Software) *
;*								     	*
;*----------------------------------------------------------------------*
;* Rev. |  Released   | Programmer    | Comments                        *
;*----------------------------------------------------------------------*
;* 0.1  | 12.11.1991  | Th. Fischler  | Module creation                 *
;* 5.00 | 20.10.1994  | E. Glatz      | Release 5.00                    *
;* 7.00 | 13.11.2001  | T. Mueller    | Release 7.00                    *
;************************************************************************
;*    Copyright 1991 .. 2001 METTLER  &  FUCHS  AG,  CH-8953 Dietikon   *
;************************************************************************


;*----------------------------------------------------------------------*
;*	I M P O R T S
;*----------------------------------------------------------------------*


EXTRN DATA     (?RTX_IE)      ; Interrupt-mask variable from RTXCONF.A51

; RTX-51 V4.xx system-functions
EXTRN   CODE (_isr_send_message)
EXTRN	CODE (_isr_recv_message)
EXTRN	CODE (_isr_send_signal)
EXTRN   CODE (_os_enable_isr)
EXTRN   CODE (_os_disable_isr)
EXTRN   CODE (_os_create_pool)
EXTRN   CODE (_os_get_block)
EXTRN   CODE (_os_free_block)


;*----------------------------------------------------------------------*
;*	E X P O R T S
;*----------------------------------------------------------------------*

PUBLIC  ?p_isr_send_message?BYTE
PUBLIC	p_isr_send_message
PUBLIC  ?p_isr_recv_message?BYTE
PUBLIC	p_isr_recv_message
PUBLIC  ?p_isr_send_signal?BYTE
PUBLIC	p_isr_send_signal
PUBLIC  ?p_os_enable_isr?BYTE
PUBLIC	p_os_enable_isr
PUBLIC  ?p_os_disable_isr?BYTE
PUBLIC	p_os_disable_isr
PUBLIC  ?p_os_create_pool?BYTE
PUBLIC	p_os_create_pool
PUBLIC  ?p_os_get_block?BYTE
PUBLIC	p_os_get_block
PUBLIC  ?p_os_free_block?BYTE
PUBLIC	p_os_free_block


;*----------------------------------------------------------------------*
;*      S E G M E N T   D E F I N I T I O N S
;*----------------------------------------------------------------------*

; One Segment for all Code and Data in this File
?RTX?PLM2CINTF_CODE?RTXPLM2             SEGMENT CODE
?RTX?PLM2CINTF_DATA?RTXPLM2             SEGMENT DATA


;*----------------------------------------------------------------------*
;*      D A T A   D E F I N I T I O N S
;*----------------------------------------------------------------------*

; PL/M-51 compatible Parameter area in DATA-memory

        RSEG  ?RTX?PLM2CINTF_DATA?RTXPLM2
?p_isr_send_message?BYTE:
mailbox?150:		DS  1
message?150:		DS  2

        ORG 0
?p_isr_recv_message?BYTE:
mailbox?170:		DS  1
message?170:		DS  2

        ORG 0
?p_isr_send_signal?BYTE:
task_number?160:        DS  1

        ORG 0
?p_os_enable_isr?BYTE:
interrupt_nbr?60:	DS  1

        ORG 0
?p_os_disable_isr?BYTE:
interrupt_nbr?70:	DS  1

        ORG 0
?p_os_get_block?BYTE:
block_size?190:		DS  2

        ORG 0
?p_os_free_block?BYTE:
block_size?200:		DS  2
block?200:		DS  2

        ORG 0
?p_os_create_pool?BYTE:              ; The greatest Parameter-field in this
block_size?180:         DS  2        ; Segment must be the last !
memory?180:             DS  2        ; (for proper segment-size allocation
mem_size?180:           DS  2        ; by BL-51)



;*----------------------------------------------------------------------*
;*      P R O C E D U R E   D E F I N I T I O N S
;*----------------------------------------------------------------------*

;
; 
; alien signed char p_isr_send_message (unsigned char mailbox,

        RSEG  ?RTX?PLM2CINTF_CODE?RTXPLM2
p_isr_send_message:
			; SOURCE LINE # 162
;                                       unsigned int message)
; {
			; SOURCE LINE # 164
;    return isr_send_message (mailbox, message);
			; SOURCE LINE # 165
	MOV  	R7,mailbox?150
	MOV  	R5,message?150+01H
	MOV  	R4,message?150
        SETB    ?RTX_IE.7                   ; enable all Interrupts
        LCALL   _isr_send_message
	MOV  	A,R7
; }
			; SOURCE LINE # 166
?C0016:
	RET  	
; END OF p_isr_send_message

;
; 
; alien signed char p_isr_recv_message (unsigned char mailbox,

        RSEG  ?RTX?PLM2CINTF_CODE?RTXPLM2
p_isr_recv_message:
			; SOURCE LINE # 175
;                                       unsigned int xdata *message)
; {
			; SOURCE LINE # 177
;    return isr_recv_message (mailbox, message);
			; SOURCE LINE # 178
	MOV  	R7,mailbox?170
	MOV  	R5,message?170+01H
	MOV  	R4,message?170
        SETB    ?RTX_IE.7                   ; enable all Interrupts
        LCALL   _isr_recv_message
	MOV  	A,R7
; }
			; SOURCE LINE # 179
?C0018:
	RET  	
; END OF p_isr_recv_message

;
; 
; alien signed char p_isr_send_signal (unsigned char task_number)

        RSEG  ?RTX?PLM2CINTF_CODE?RTXPLM2
p_isr_send_signal:
			; SOURCE LINE # 169
; {
			; SOURCE LINE # 170
;    return isr_send_signal (task_number);
			; SOURCE LINE # 171
	MOV  	R7,task_number?160
        SETB    ?RTX_IE.7                   ; enable all Interrupts
        LCALL   _isr_send_signal
	MOV  	A,R7
; }
			; SOURCE LINE # 172
?C0017:
	RET  	
; END OF p_isr_send_signal

;
; 
; alien signed char p_os_enable_isr (unsigned char interrupt_nbr)

        RSEG  ?RTX?PLM2CINTF_CODE?RTXPLM2
p_os_enable_isr:
			; SOURCE LINE # 103
; {
			; SOURCE LINE # 104
;    return os_enable_isr (interrupt_nbr);
			; SOURCE LINE # 105
	MOV  	R7,interrupt_nbr?60
        SETB    ?RTX_IE.7                   ; enable all Interrupts
        LCALL   _os_enable_isr
	MOV  	A,R7
; }
			; SOURCE LINE # 106
?C0007:
	RET  	
; END OF p_os_enable_isr

; 
; 
; alien signed char p_os_disable_isr (unsigned char interrupt_nbr)

        RSEG  ?RTX?PLM2CINTF_CODE?RTXPLM2
p_os_disable_isr:
			; SOURCE LINE # 109
; {
			; SOURCE LINE # 110
;    return os_disable_isr (interrupt_nbr);
			; SOURCE LINE # 111
	MOV  	R7,interrupt_nbr?70
        SETB    ?RTX_IE.7                   ; enable all Interrupts
        LCALL   _os_disable_isr
	MOV  	A,R7
; }
			; SOURCE LINE # 112
?C0008:
	RET  	
; END OF p_os_disable_isr

;
; 
; alien signed char p_os_create_pool (unsigned int block_size,

        RSEG  ?RTX?PLM2CINTF_CODE?RTXPLM2
p_os_create_pool:
			; SOURCE LINE # 182
;                                     void xdata *memory,
;                                     unsigned int mem_size)
; {
			; SOURCE LINE # 185
;    return os_create_pool (block_size, memory, mem_size);
			; SOURCE LINE # 186
	MOV  	R7,block_size?180+01H
	MOV  	R6,block_size?180
	MOV  	R5,memory?180+01H
	MOV  	R4,memory?180
	MOV  	R3,mem_size?180+01H
	MOV  	R2,mem_size?180
        SETB    ?RTX_IE.7                   ; enable all Interrupts
        LCALL   _os_create_pool
	MOV  	A,R7
; }
			; SOURCE LINE # 187
?C0019:
	RET  	
; END OF p_os_create_pool

; 
; 
; alien void xdata *p_os_get_block (unsigned int block_size)

        RSEG  ?RTX?PLM2CINTF_CODE?RTXPLM2
p_os_get_block:
			; SOURCE LINE # 190
; {
			; SOURCE LINE # 191
;    return os_get_block (block_size);
			; SOURCE LINE # 192
	MOV  	R7,block_size?190+01H
	MOV  	R6,block_size?190
        SETB    ?RTX_IE.7                   ; enable all Interrupts
        LCALL   _os_get_block
; }
			; SOURCE LINE # 193
?C0020:
	RET  	
; END OF p_os_get_block

; 
; 
; alien signed char p_os_free_block (unsigned int block_size,

        RSEG  ?RTX?PLM2CINTF_CODE?RTXPLM2
p_os_free_block:
			; SOURCE LINE # 196
;                                    void xdata *block)
; {
			; SOURCE LINE # 198
;    return os_free_block (block_size, block);
			; SOURCE LINE # 199
	MOV  	R7,block_size?200+01H
	MOV  	R6,block_size?200
	MOV  	R5,block?200+01H
	MOV  	R4,block?200
        SETB    ?RTX_IE.7                   ; enable all Interrupts
        LCALL   _os_free_block
	MOV  	A,R7
; }
			; SOURCE LINE # 200
?C0021:
	RET  	
; END OF p_os_free_block


;
;   END OF MODULE
;
	END
